package com.xx.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xx.entity.Products;
import com.xx.mapper.ProductsMapper;
import com.xx.service.IProductsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 供应商商品信息表 服务实现类
 * </p>
 *
 * @author myx
 * @since 2024-12-10
 */
@Service
public class ProductsServiceImpl implements IProductsService {
    @Autowired
    ProductsMapper productsMapper;

    @Override
    public Products getProductWithSupplier(Integer productId) {
        return productsMapper.selectProductWithSupplier(productId);
    }

    @Override
    public Page<Products> getProductPageWithSupplier(Page<Products> page) {
        return productsMapper.selectPageWithSupplier(page);
    }

    @Override
    public int insertProduct(Products products) {
        return productsMapper.insertProduct(products);
    }

    @Override
    public int updateProduct(Products products) {
        return productsMapper.updateProduct(products);
    }

    @Override
    public int deleteProduct(Integer productId) {
        return productsMapper.deleteProduct(productId);
    }
}
